package com.eb.dao;

import com.eb.pojo.Goods;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.Map;

public interface GoodsDao extends JpaRepository<Goods,Long> {

    @Query(value = "SELECT * FROM goods WHERE goods_name like ?1",nativeQuery = true,
    countQuery = "select  count(*) from  goods")
    Page<Map<String, Object>> mohu(String goodsName, Pageable of);


}
